module "resourcepool" {
    source                  = "../../../modules/maas/resource_pool"
    resource_pool_name      = "cicd-k8s-cluster"
}

module "machine-10-3-8-9" {
    source                  = "../../../modules/maas/machine"
    enabled                 = true
    ipmi_power_address      = "10.253.253.1"
    ipmi_power_user         = "deeproute"
    ipmi_power_pass         = "Yrqxicr@123"
    machine_hostname        = "10-3-8-9"
    machine_cidr            = "10.3.8.0/22"
    machine_ip_address      = "10.3.8.9"
    machine_pool            = module.resourcepool.name
    instance_image          = "ubuntu-20.04-2023-07-27-1690454620" 
    # volume_docker_data_disk = true #TODO： 大容量硬盘斩时无法准确分区，怀疑是provider中数值计算问题，因此关闭自动配置分区功能，采用手动分区
}

module "machine-10-3-8-10" {
    source                  = "../../../modules/maas/machine"
    enabled                 = true
    ipmi_power_address      = "10.253.253.2"
    ipmi_power_user         = "deeproute"
    ipmi_power_pass         = "Yrqxicr@123"
    machine_hostname        = "10-3-8-10"
    machine_cidr            = "10.3.8.0/22"
    machine_ip_address      = "10.3.8.10"
    machine_pool            = module.resourcepool.name
    instance_image          = "ubuntu-20.04-2023-07-27-1690454620" 
    # volume_docker_data_disk = true #TODO： 大容量硬盘斩时无法准确分区，怀疑是provider中数值计算问题，因此关闭自动配置分区功能，采用手动分区
}

module "machine-10-3-11-108" {
    source                  = "../../../modules/maas/machine"
    enabled                 = true
    ipmi_power_address      = "10.253.253.124"
    ipmi_power_user         = "deeproute"
    ipmi_power_pass         = "Yrqxicr@123"
    machine_hostname        = "10-3-11-108"
    machine_cidr            = "10.3.8.0/22"
    machine_ip_address      = "10.3.11.108"
    machine_pool            = module.resourcepool.name
    instance_image          = "ubuntu-20.04-2023-07-27-1690454620" 
    volume_docker_data_disk = true
}

module "machine-10-3-11-109" {
    source                  = "../../../modules/maas/machine"
    enabled                 = true
    ipmi_power_address      = "10.253.253.125"
    ipmi_power_user         = "deeproute"
    ipmi_power_pass         = "Yrqxicr@123"
    machine_hostname        = "10-3-11-109"
    machine_cidr            = "10.3.8.0/22"
    machine_ip_address      = "10.3.11.109"
    machine_pool            = module.resourcepool.name
    instance_image          = "ubuntu-20.04-2023-07-27-1690454620" 
    volume_docker_data_disk = true
}

module "machine-10-3-11-110" {
    source                  = "../../../modules/maas/machine"
    enabled                 = true
    ipmi_power_address      = "10.253.253.126"
    ipmi_power_user         = "deeproute"
    ipmi_power_pass         = "Yrqxicr@123"
    machine_hostname        = "10-3-11-110"
    machine_cidr            = "10.3.8.0/22"
    machine_ip_address      = "10.3.11.110"
    machine_pool            = module.resourcepool.name
    instance_image          = "ubuntu-20.04-2023-07-27-1690454620" 
    instance_hwe_kernel     = "hwe-20.04"
    volume_docker_data_disk = true
}

module "machine-10-3-8-63" {
    source                  = "../../../modules/maas/machine"
    enabled                 = true
    ipmi_power_address      = "10.253.253.143"
    ipmi_power_user         = "deeproute"
    ipmi_power_pass         = "YS1^qwz@123"
    machine_hostname        = "10-3-8-63"
    machine_cidr            = "10.3.8.0/22"
    machine_ip_address      = "10.3.8.63"
    machine_pool            = module.resourcepool.name
    instance_image          = "ubuntu-20.04-2023-07-27-1690454620"
    volume_docker_data_disk = true
}

module "machine-10-3-9-37" {
    source                  = "../../../modules/maas/machine"
    enabled                 = true
    ipmi_power_address      = "10.253.253.68"
    ipmi_power_user         = "admin"
    ipmi_power_pass         = "Flzx3kc@h3c"
    machine_hostname        = "10-3-9-37"
    machine_cidr            = "10.3.8.0/22"
    machine_ip_address      = "10.3.9.37"
    machine_pool            = module.resourcepool.name
    instance_image          = "ubuntu-20.04-2023-07-27-1690454620"
    volume_docker_data_disk = true
}

module "machine-10-3-9-28" {
    source                  = "../../../modules/maas/machine"
    enabled                 = true
    ipmi_power_address      = "10.253.253.54"
    ipmi_power_user         = "deeproute"
    ipmi_power_pass         = "Yrqxicr@123"
    machine_hostname        = "10-3-9-28"
    machine_cidr            = "10.3.8.0/22"
    machine_ip_address      = "10.3.9.28"
    machine_pool            = module.resourcepool.name
    instance_image          = "ubuntu-20.04-hwe-2023-07-28-1690587096" 
    volume_docker_data_disk = true
}

module "machine-10-3-9-29" {
    source                  = "../../../modules/maas/machine"
    enabled                 = true
    ipmi_power_address      = "10.253.253.55"
    ipmi_power_user         = "deeproute"
    ipmi_power_pass         = "Yrqxicr@123"
    machine_hostname        = "10-3-9-29"
    machine_cidr            = "10.3.8.0/22"
    machine_ip_address      = "10.3.9.29"
    machine_pool            = module.resourcepool.name
    instance_image          = "ubuntu-20.04-hwe-2023-07-28-1690587096" 
    volume_docker_data_disk = true
}

module "machine-10-3-8-152" {
    source                  = "../../../modules/maas/machine"
    enabled                 = true
    ipmi_power_address      = "10.253.253.149"
    ipmi_power_user         = "USERID"
    ipmi_power_pass         = "Flzx3kc@lx"
    machine_hostname        = "10-3-8-152"
    machine_cidr            = "10.3.8.0/22"
    machine_ip_address      = "10.3.8.152"
    machine_pool            = module.resourcepool.name
    instance_image          = "ubuntu-20.04-hwe-2023-07-28-1690587096" 
    volume_docker_data_disk = true
}


# module "machine-10-3-8-150" {
#     source                  = "../../../modules/maas/machine"
#     enabled                 = false
#     ipmi_power_address      = "10.253.253.52"
#     ipmi_power_user         = "admin"
#     ipmi_power_pass         = "Flzx3kc@h3c"
#     machine_hostname        = "10-3-8-150"
#     machine_cidr            = "10.3.8.0/22"
#     machine_ip_address      = "10.3.8.150"
#     machine_pool            = module.resourcepool.name
#     instance_image          = "ubuntu-20.04-hwe-2023-07-28-1690587096" 
# }

module "machine-10-3-8-151" {
    source                  = "../../../modules/maas/machine"
    enabled                 = true
    ipmi_power_address      = "10.253.253.148"
    ipmi_power_user         = "USERID"
    ipmi_power_pass         = "Flzx3kc@lx"
    machine_hostname        = "10-3-8-151"
    machine_cidr            = "10.3.8.0/22"
    machine_ip_address      = "10.3.8.151"
    machine_pool            = module.resourcepool.name
    instance_image          = "ubuntu-20.04-hwe-2023-07-28-1690587096" 
    volume_docker_data_disk = true
}